package org.example.ch05;

import org.example.ch05.entity.User;
import org.example.ch05.service.UserService;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ClassName: Main
 * Description:
 *
 * @Author zjl
 * @Create 2025/04/23 15:11
 * @Version 1.0
 */
public class Main {

    public static void main(String[] args) {
        UserService service = new UserService();
        Map<String, Object> params = new HashMap<>();
//        params.put("name", "USER1");
        List<User> list = service.getUser(params);
        list.forEach(user -> {
            System.out.println(user.getId());
            System.out.println(user.getName());
            System.out.println(user.getAge());
        });


        List<Integer> ids = Arrays.asList(1, 2, 3);
        list = service.listUserById(ids);


        User user = new User();
        user.setId(1);
        user.setName("USER1");
        service.update(user);
    }
}
